package com.ai.controller.security;


import com.ai.annotation.EnterPathParamLog;
import com.ai.common.CommonResponse;
import com.ai.model.param.SysRolePermissionParam;
import com.ai.service.security.ISysRolePermissionRelationService;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 角色-权限关联关系表 前端控制器
 * </p>
 *
 *  不同的角色 具有不同的权限，
 *  具体哪个角色可以做什么，在这里进行维护
 *
 * @author chen
 * @since 2023-04-04 19:46:07
 */
@RestController
@RequestMapping("/sys-role-permission-relation")
public class SysRolePermissionRelationController {

    @Resource
    private ISysRolePermissionRelationService permissionRelationService;



    /**
     * 更新角色的权限
     *
     * @param permissionParam
     * @return
     */
    @ApiOperation("更新指定角色的权限")
    @PostMapping("update")
    @EnterPathParamLog
    public CommonResponse<String> update(@RequestBody @Validated SysRolePermissionParam permissionParam) {
        return permissionRelationService.updateRolePermission(permissionParam);
    }


}

